<template>
	<div class="app-container">
		<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
			<div class="app-space-between">
				<div class="app-space-between-left">
					<el-form-item label="订单编号:" prop="couponName">
						<el-input v-model="queryParams.couponName" placeholder="请输入订单编号" clearable @clear="handleQuery" />
					</el-form-item>
					<el-form-item label="手机号:" prop="couponName">
						<el-input v-model="queryParams.couponName" placeholder="请输入手机号" clearable
							@clear="handleQuery" />
					</el-form-item>
					<el-form-item label="台餐卡号:" prop="couponName">
						<el-input v-model="queryParams.couponName" placeholder="请输入台餐卡号" clearable
							@clear="handleQuery" />
					</el-form-item>

					<el-form-item label="支付类型:" prop="couponType">
						<el-select v-model="queryParams.couponType" placeholder="请选择状态" @change="handleQuery">
							<el-option v-for="item in couponTypeEnum" :key="item.value" :label="item.label"
								:value="item.value" />
						</el-select>
					</el-form-item>
				</div>
				<div class="app-space-between-right">
					<el-form-item>
						<el-button type="primary" size="mini" @click="handleQuery">搜索</el-button>
						<el-button size="mini" @click="resetQuery">重置</el-button>
					</el-form-item>
				</div>
			</div>
		</el-form>

		<el-row :gutter="10" class="mb8">
			<el-col :span="1.5">
				<el-button type="primary" plain size="mini" @click="handleAdd">导出</el-button>
			</el-col>

			<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
		</el-row>

		<el-table v-loading="loading" :data="postList">
			<el-table-column show-overflow-tooltip label="序号" type="index" width="50" align="center" prop="couponName" />
			<el-table-column show-overflow-tooltip label="姓名" width="140" align="center" prop="couponName" />
			<el-table-column show-overflow-tooltip label="手机号" width="140" align="center" prop="couponName" />
			<el-table-column show-overflow-tooltip label="台餐卡号" width="180" align="center" prop="couponName" />
			<el-table-column show-overflow-tooltip label="消费场景" min-width="120" align="center" prop="couponName" />
			<el-table-column show-overflow-tooltip label="订单编号" min-width="80" align="center" prop="couponName" />
			<el-table-column show-overflow-tooltip label="支付/收入金额(元)" width="180" align="center" prop="couponName" />
			<el-table-column show-overflow-tooltip label="支付时间" min-width="200" align="center" prop="couponName" />
			<el-table-column show-overflow-tooltip label="支付类型" min-width="80" align="center" prop="couponName" />
		</el-table>
		<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
			@pagination="getList" />
			
	</div>
</template>

<script>
	import {
		listWcCoupon
	} from "@/api/culturalCreativity/coupon.js";
	export default {
		data() {
			return {
				// 遮罩层
				loading: true,
				// 选中数组
				ids: [],
				// 非单个禁用
				single: true,
				// 非多个禁用
				multiple: true,
				// 显示搜索条件
				showSearch: true,
				// 总条数
				total: 0,
				// 岗位表格数据
				postList: [],
				// 弹出层标题
				queryParams: {
					pageNum: 1,
					pageSize: 10,
					couponName: '', // 优惠券名称
					couponType: '', // 优惠券类型
					getCouponStartTime: '', // 优惠券领取开始时间
					getCouponEndTime: '', // 优惠券领取结束时间
					validiteStart: '', // 优惠券使用开始时间
					validiteEnd: '', // 优惠券使用结束时间
				},
				getCouponTimeList: [], // 优惠券领取时间
				couponTypeEnum: [{
					label: '满减',
					value: '1'
				}, {
					label: '直减',
					value: '2'
				}]
			};
		},
		created() {
			this.getList();
		},
		methods: {
			/** 查询岗位列表 */
			getList() {
				this.queryParams.getCouponStartTime = this.getCouponTimeList[0];
					this.queryParams.getCouponEndTime = this.getCouponTimeList[1];
					this.loading = true;
				listWcCoupon({}, this.queryParams).then(response => {
					this.postList = response.rows;
					this.total = response.total;
					this.loading = false;
				});
			},
			/** 搜索按钮操作 */
			handleQuery() {
				this.queryParams.pageNum = 1;
				this.getList();
			},
			/** 重置按钮操作 */
			resetQuery() {
				this.getCouponTimeList = [];
				this.resetForm("queryForm");
				this.handleQuery();
			},
		}
	};
</script>
<style lang="scss" scoped>
	.brother+.brother {
		margin-left: 6px;
	}
</style>
